home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / catD / makedevice.z / makedevice
Encoding:
Text File  |  1998-10-30  |  12.1 KB  |  131 lines

  1.  
  2.  
  3.  
  4. mmmmaaaakkkkeeeeddddeeeevvvviiiicccceeee((((DDDD3333))))                                                  mmmmaaaakkkkeeeeddddeeeevvvviiiicccceeee((((DDDD3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _mmmm_aaaa_kkkk_eeee_dddd_eeee_vvvv_iiii_cccc_eeee - make device number from major and minor numbers
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>>
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_dddd_dddd_iiii_...._hhhh_>>>>
  14.      _dddd_eeee_vvvv______tttt _mmmm_aaaa_kkkk_eeee_dddd_eeee_vvvv_iiii_cccc_eeee_((((_mmmm_aaaa_jjjj_oooo_rrrr______tttt _m_a_j_n_u_m_,,,, _mmmm_iiii_nnnn_oooo_rrrr______tttt _m_i_n_n_u_m_))))_;;;;
  15.  
  16.    AAAArrrrgggguuuummmmeeeennnnttttssss
  17.      _m_a_j_n_u_m    Major number.
  18.  
  19.      _m_i_n_n_u_m    Minor number.
  20.  
  21. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  22.      The _mmmm_aaaa_kkkk_eeee_dddd_eeee_vvvv_iiii_cccc_eeee function creates a device number from major and minor
  23.      device numbers.
  24.  
  25.    RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss
  26.      The device number, containing both the major number and the minor number,
  27.      is returned.  No validation of the major or minor numbers is performed.
  28.  
  29. UUUUSSSSAAAAGGGGEEEE
  30.      _mmmm_aaaa_kkkk_eeee_dddd_eeee_vvvv_iiii_cccc_eeee should be used to create device numbers so that the driver
  31.      will port easily to releases that treat device numbers differently.
  32.  
  33.    LLLLeeeevvvveeeellll
  34.      Initialization, Base or Interrupt.
  35.  
  36.    SSSSyyyynnnncccchhhhrrrroooonnnniiiizzzzaaaattttiiiioooonnnn CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss
  37.      Does not sleep.
  38.  
  39.      Driver-defined basic locks, read/write locks, and sleep locks may be held
  40.      across calls to this function.
  41.  
  42.    SSSSiiiinnnngggglllleeeetttthhhhrrrreeeeaaaaddddeeeedddd EEEExxxxaaaammmmpppplllleeee
  43.      In the following example, _mmmm_aaaa_kkkk_eeee_dddd_eeee_vvvv_iiii_cccc_eeee is used to create the device number
  44.      selected during a clone open.  If the _CCCC_LLLL_OOOO_NNNN_EEEE_OOOO_PPPP_EEEE_NNNN flag is set (line 9), we
  45.      search through the list of minor devices looking for one that is
  46.      available (lines 10-11).  If we find an unused minor, we break off the
  47.      search, create a new device number, and store it in the memory location
  48.      pointed to by _dddd_eeee_vvvv_pppp (line 15).  If no unused minor was found, we return
  49.      the error _EEEE_NNNN_XXXX_IIII_OOOO.
  50.  
  51.      _1111  _xxxx_xxxx_xxxx_oooo_pppp_eeee_nnnn_((((_qqqq_,,,, _dddd_eeee_vvvv_pppp_,,,, _oooo_ffff_llll_aaaa_gggg_,,,, _ssss_ffff_llll_aaaa_gggg_,,,, _cccc_rrrr_pppp_))))
  52.      _2222    _qqqq_uuuu_eeee_uuuu_eeee______tttt _****_qqqq_;;;;
  53.      _3333    _dddd_eeee_vvvv______tttt _****_dddd_eeee_vvvv_pppp_;;;;
  54.      _4444    _iiii_nnnn_tttt _oooo_ffff_llll_aaaa_gggg_;;;;
  55.      _5555    _iiii_nnnn_tttt _ssss_ffff_llll_aaaa_gggg_;;;;
  56.      _6666    _cccc_rrrr_eeee_dddd______tttt _****_cccc_rrrr_pppp_;;;;
  57.      _7777  _{{{{
  58.      _8888    _mmmm_iiii_nnnn_oooo_rrrr______tttt _mmmm_iiii_nnnn_nnnn_uuuu_mmmm_;;;;
  59.  
  60.  
  61.                                                                         PPPPaaaaggggeeee 1111
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68. mmmmaaaakkkkeeeeddddeeeevvvviiiicccceeee((((DDDD3333))))                                                  mmmmaaaakkkkeeeeddddeeeevvvviiiicccceeee((((DDDD3333))))
  69.  
  70.  
  71.  
  72.      _9999    _iiii_ffff _((((_ssss_ffff_llll_aaaa_gggg _====_==== _CCCC_LLLL_OOOO_NNNN_EEEE_OOOO_PPPP_EEEE_NNNN_)))) _{{{{
  73.      _1111_0000        _ffff_oooo_rrrr _((((_mmmm_iiii_nnnn_nnnn_uuuu_mmmm _==== _0000_;;;; _mmmm_iiii_nnnn_nnnn_uuuu_mmmm _<<<< _XXXX_XXXX_XXXX_MMMM_AAAA_XXXX_MMMM_IIII_NNNN_;;;; _mmmm_iiii_nnnn_nnnn_uuuu_mmmm_++++_++++_))))
  74.      _1111_1111            _iiii_ffff _((((_!!!!_IIII_NNNN_UUUU_SSSS_EEEE_((((_mmmm_iiii_nnnn_nnnn_uuuu_mmmm_))))_))))
  75.      _1111_2222                _bbbb_rrrr_eeee_aaaa_kkkk_;;;;
  76.      _1111_3333        _iiii_ffff _((((_mmmm_iiii_nnnn_nnnn_uuuu_mmmm _>>>>_==== _XXXX_XXXX_XXXX_MMMM_AAAA_XXXX_MMMM_IIII_NNNN_))))
  77.      _1111_4444            _rrrr_eeee_tttt_uuuu_rrrr_nnnn_((((_EEEE_NNNN_XXXX_IIII_OOOO_))))_;;;;
  78.      _1111_5555            _SSSS_EEEE_TTTT_IIII_NNNN_UUUU_SSSS_EEEE_((((_mmmm_iiii_nnnn_nnnn_uuuu_mmmm_))))_;;;;
  79.      _1111_6666        _****_dddd_eeee_vvvv_pppp _==== _mmmm_aaaa_kkkk_eeee_dddd_eeee_vvvv_iiii_cccc_eeee_((((_gggg_eeee_tttt_eeee_mmmm_aaaa_jjjj_oooo_rrrr_((((_****_dddd_eeee_vvvv_pppp_))))_,,,, _mmmm_iiii_nnnn_nnnn_uuuu_mmmm_))))_;;;;
  80.      _1111_7777    _}}}}
  81.          _...._...._....
  82.  
  83.    MMMMuuuullllttttiiiitttthhhhrrrreeeeaaaaddddeeeedddd EEEExxxxaaaammmmpppplllleeee
  84.      In the following example, _mmmm_aaaa_kkkk_eeee_dddd_eeee_vvvv_iiii_cccc_eeee is used to create the device number
  85.      selected during a clone open.  If the _CCCC_LLLL_OOOO_NNNN_EEEE_OOOO_PPPP_EEEE_NNNN flag is set (line 11), we
  86.      lock the list of minor devices (line 12) and search through the list,
  87.      looking for a minor device that is available (lines 13-14).  If we find
  88.      an unused minor, we break off the search, mark the minor as being in use
  89.      (line 20), unlock the list, create a new device number, and store it in
  90.      the memory location pointed to by _dddd_eeee_vvvv_pppp (line 22).  If no unused minor was
  91.      found, we unlock the list and return the error _EEEE_NNNN_XXXX_IIII_OOOO.
  92.  
  93.      _1111  _xxxx_xxxx_xxxx_oooo_pppp_eeee_nnnn_((((_qqqq_,,,, _dddd_eeee_vvvv_pppp_,,,, _oooo_ffff_llll_aaaa_gggg_,,,, _ssss_ffff_llll_aaaa_gggg_,,,, _cccc_rrrr_pppp_))))
  94.      _2222    _qqqq_uuuu_eeee_uuuu_eeee______tttt _****_qqqq_;;;;
  95.      _3333    _dddd_eeee_vvvv______tttt _****_dddd_eeee_vvvv_pppp_;;;;
  96.      _4444    _iiii_nnnn_tttt _oooo_ffff_llll_aaaa_gggg_;;;;
  97.      _5555    _iiii_nnnn_tttt _ssss_ffff_llll_aaaa_gggg_;;;;
  98.      _6666    _cccc_rrrr_eeee_dddd______tttt _****_cccc_rrrr_pppp_;;;;
  99.      _7777  _{{{{
  100.      _8888    _mmmm_iiii_nnnn_oooo_rrrr______tttt _mmmm_iiii_nnnn_nnnn_uuuu_mmmm_;;;;
  101.      _9999    _iiii_nnnn_tttt _pppp_llll_;;;;
  102.      _1111_0000    _eeee_xxxx_tttt_eeee_rrrr_nnnn _llll_oooo_cccc_kkkk______tttt _****_xxxx_xxxx_xxxx_mmmm_iiii_nnnn_llll_oooo_cccc_kkkk_;;;;
  103.      _1111_1111    _iiii_ffff _((((_ssss_ffff_llll_aaaa_gggg _====_==== _CCCC_LLLL_OOOO_NNNN_EEEE_OOOO_PPPP_EEEE_NNNN_)))) _{{{{
  104.      _1111_2222        _pppp_llll _==== _LLLL_OOOO_CCCC_KKKK_((((_xxxx_xxxx_xxxx_mmmm_iiii_nnnn_llll_oooo_cccc_kkkk_,,,, _pppp_llll_ssss_tttt_rrrr_))))_;;;;
  105.      _1111_3333        _ffff_oooo_rrrr _((((_mmmm_iiii_nnnn_nnnn_uuuu_mmmm _==== _0000_;;;; _mmmm_iiii_nnnn_nnnn_uuuu_mmmm _<<<< _XXXX_XXXX_XXXX_MMMM_AAAA_XXXX_MMMM_IIII_NNNN_;;;; _mmmm_iiii_nnnn_nnnn_uuuu_mmmm_++++_++++_))))
  106.      _1111_4444            _iiii_ffff _((((_!!!!_IIII_NNNN_UUUU_SSSS_EEEE_((((_mmmm_iiii_nnnn_nnnn_uuuu_mmmm_))))_))))
  107.      _1111_5555                _bbbb_rrrr_eeee_aaaa_kkkk_;;;;
  108.      _1111_6666        _iiii_ffff _((((_mmmm_iiii_nnnn_nnnn_uuuu_mmmm _>>>>_==== _XXXX_XXXX_XXXX_MMMM_AAAA_XXXX_MMMM_IIII_NNNN_)))) _{{{{
  109.      _1111_7777            _UUUU_NNNN_LLLL_OOOO_CCCC_KKKK_((((_xxxx_xxxx_xxxx_mmmm_iiii_nnnn_llll_oooo_cccc_kkkk_,,,, _pppp_llll_))))_;;;;
  110.      _1111_8888            _rrrr_eeee_tttt_uuuu_rrrr_nnnn_((((_EEEE_NNNN_XXXX_IIII_OOOO_))))_;;;;
  111.      _1111_9999        _}}}} _eeee_llll_ssss_eeee _{{{{
  112.      _2222_0000            _SSSS_EEEE_TTTT_IIII_NNNN_UUUU_SSSS_EEEE_((((_mmmm_iiii_nnnn_nnnn_uuuu_mmmm_))))_;;;;
  113.      _2222_1111            _UUUU_NNNN_LLLL_OOOO_CCCC_KKKK_((((_xxxx_xxxx_xxxx_mmmm_iiii_nnnn_llll_oooo_cccc_kkkk_,,,, _pppp_llll_))))_;;;;
  114.      _2222_2222            _****_dddd_eeee_vvvv_pppp _==== _mmmm_aaaa_kkkk_eeee_dddd_eeee_vvvv_iiii_cccc_eeee_((((_gggg_eeee_tttt_eeee_mmmm_aaaa_jjjj_oooo_rrrr_((((_****_dddd_eeee_vvvv_pppp_))))_,,,, _mmmm_iiii_nnnn_nnnn_uuuu_mmmm_))))_;;;;
  115.      _2222_3333        _}}}}
  116.      _2222_4444    _}}}}
  117.              _...._...._....
  118.  
  119. RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEESSSS
  120.      _gggg_eeee_tttt_eeee_mmmm_aaaa_jjjj_oooo_rrrr(D3), _gggg_eeee_tttt_eeee_mmmm_iiii_nnnn_oooo_rrrr(D3), _gggg_eeee_tttt_mmmm_aaaa_jjjj_oooo_rrrr(D3), _gggg_eeee_tttt_mmmm_iiii_nnnn_oooo_rrrr(D3)
  121.  
  122.  
  123.  
  124.  
  125.                                                                         PPPPaaaaggggeeee 2222
  126.  
  127.  
  128.  
  129.